<p class="Paragraph"><help:paragraphinfo state="U" number="2"/>When a program encounters a While statement, it tests the condition. If the condition is False, the program continues directly following the Wend statement. If the condition is True, the loop is executed until the program finds Wend and then jumps back to the<span style="font-weight:bold;"> While </span>statement. If the condition is still True, the loop is executed again.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="3" xmlns:help="http://openoffice.org/2000/help"/>Unlike the <help:link Id="66463" Eid="doloop" xmlns:help="http://openoffice.org/2000/help">Do...Loop</help:link> statement, you cannot cancel a <span class="T1">While...Wend</span> loop with <help:link Id="66590" Eid="exit" xmlns:help="http://openoffice.org/2000/help">Exit</help:link>. Never exit a While...Wend loop with <help:link Id="66534" Eid="goto" xmlns:help="http://openoffice.org/2000/help">GoTo</help:link>, since this can cause a run-time error.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="4" xmlns:help="http://openoffice.org/2000/help"/>A Do...Loop is more flexible than a While...Wend.</p>